import 'package:flutter_web_server/ImcludeServer.dart';
import 'package:flutter_web_server/controller_server/ServerUpload.dart';

class ServerRouter {
  // 注册路由
  static registRouter(Router router) {
    // 定义动态路由
    router.get("/snjj", (Request request) {
      //var map = request.url.queryParameters;
      //print("请求的参数 = $map");

      // var body = await request.readAsString();
      // // 解析请求体（假设请求体是 JSON 格式）
      // var map = jsonDecode(body);
      // print("请求的参数 = $map");

      return ServerR(msg: "Hello snjj").toOK();
    });

    // 文件上传
    router.post("/upload", ServerUpload.upload);
  }
}
